package com.gai.shop.dao;

import com.gai.shop.entity.Address;

import java.util.List;

public interface AddressDao {
    /**
     * 获取地址数据
     * @param uid
     * @return
     */
    List<Address> selectAddressByUid(Integer uid) throws Exception;

    /**
     * 新增
     * @param address
     * @return
     */
    Integer InsertIntoAddress(Address address) throws Exception;

    /**
     * 删除
     * @param aid
     * @return
     */
    Integer deleteAddressByAid(Integer aid) throws Exception;

    /**
     * 修改地址
     * @param address
     * @return
     */
    Integer updateAddress(Address address) throws Exception;

    /**
     * 修改地址为默认
     * aid直接代表我们要设置为默认 地址的数据
     * @param aid
     * @return
     */
    Integer updateAddressByAidSetAstate(Integer aid) throws Exception;

    /**
     * 修改其他地址为非默认
     * aid直接代表我们要设置为默认地址的数据
     * uid为了防止我们修改到其他用户的地址数据
     * @param aid
     * @param uid
     * @return
     */
    Integer updateAddressByAidAndUidSetAstate(Integer aid,Integer uid) throws Exception;
}
